using System;
using System.Collections.Generic;
using System.Text;

namespace CoastToCoast.Game {
    public class Board {
        private int _rows;
        public int Rows {
            get { return _rows; }
            set { _rows = value; }
        }

        private int _columns;
        public int Columns {
            get { return _columns; }
            set { _columns = value; }
        }

        private Cell[][] _cells;
        public Cell[][] Cells {
            get { return _cells; }
            set { _cells = value; }
        }

        public Board(int rows, int cols) {
            Rows = rows;
            Columns = cols;
            Cells = new Cell[rows][];
            for (int i = 0; i < rows; i++) {
                Cells[i] = new Cell[cols];
                for (int c = 0; c < cols; c++) {
                    Cells[i][c] = new Cell(this);
                }
            }
        }

        public void Move(Unit unit, Cell dest) {
            if (unit.Cell != null) {
                unit.Cell.Unit = null;
            }
            dest.Unit = unit;
        }
    }
}
